#pragma once
#ifdef LIT_OGRE_SUPPORT

#ifndef __LIT__SCENE__SELECTION__HH__
#define __LIT__SCENE__SELECTION__HH__

#include <LitPrerequisites.h>
#include <LitMovable.h>

namespace Lit
{
	class LIT_API SceneSelection
	{
		MovablePtrList sel;
		Ogre::Vector3 mCenter;
	public:
		SceneSelection( );
		SceneSelection( MovablePtr& lst );
		SceneSelection( const MovablePtrList& lst );
		SceneSelection( const SceneSelection& rk );
		~SceneSelection( );
		
		MovablePtrList::Itor begin();
		MovablePtrList::Itor  end();
		MovablePtrList::ConstItor begin() const;
		MovablePtrList::ConstItor end() const;
		
		MovablePtr lowestObject() const;
		MovablePtr highestObject() const;
		Vec3 lowestPoint() const;
		Vec3 highestPoint() const;

		void setPosition( const Ogre::Vector3 &pos, bool offset_by_bbox = true );
		void clearSelection(bool unselect=true);
		void setSelectionVisible(bool state);
		bool isSelectionVisible() const;
		void setSelected( MovablePtr p, bool state );

		Ogre::Vector3 center() const;
		MovablePtrList& list();
		const MovablePtrList& list() const;

		Ogre::AxisAlignedBox getBoundingBox() const;

		bool isSingleSelection() const;
		MovablePtr::Ptr singleSelection();
		void setSingleSelection( MovablePtr mov );
		bool isSelected( MovablePtr p ) const;
		size_t size() const;
		bool empty() const;

		operator bool() const;
		bool operator == ( const SceneSelection & rk ) const;
		bool operator != ( const SceneSelection & rk ) const;
	};
	typedef RefPtr<SceneSelection> SceneSelectionPtr;

	LIT_API std::ostream& operator << ( std::ostream&, const SceneSelection& );
};
#endif

#endif // IF DEFINED LIT_OGRE_SUPPORT